<?php
namespace app\service;

use app\model\PhoneDn;
use support\Redis;
use think\facade\Db;

class DnService
{
    public static function cleanupExpired(): void
    {
        $dn_list = PhoneDn::where('unbind_at', '<', date('Y-m-d H:i:s',time()))->whereNotNull('phone')->column('dn');
        foreach ($dn_list as $dn) {
            (new YouYinService())->unbind($dn);
        }
    }
}
